package com.szis.auth.oauth2.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.szis.auth.oauth2.entity.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * <p>
 * oauth2客户端信息表
 * </p>
 *
 * @author yanxuelin
 * @since 2025-07-17
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("sys_client")
public class Client extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 客户端名称
     */
    @TableField("clientName")
    private String clientName;

    /**
     * 客户端密钥
     */
    @TableField("clientSecret")
    private String clientSecret;

    /**
     * 授权范围，逗号分隔(如：read,write)
     */
    @TableField("scope")
    private String scope;

    /**
     * 授权类型，逗号分隔(如：authorization_code,password,refresh_token)
     */
    @TableField("grantType")
    private String grantType;

    /**
     * 客户端图标URL
     */
    @TableField("clientIcon")
    private String clientIcon;

    /**
     * 授权码模式下的重定向URI
     */
    @TableField("redirectUri")
    private String redirectUri;

    /**
     * 访问令牌有效期(秒)
     */
    @TableField("accessTokenValidity")
    private Integer accessTokenValidity;

    /**
     * 刷新令牌有效期(秒)
     */
    @TableField("refreshTokenValidity")
    private Integer refreshTokenValidity;

    /**
     * 额外信息，通常存储为JSON
     */
    @TableField("extInfo")
    private String extInfo;

    /**
     * 状态(0-禁用,1-启用)
     */
    @TableField("state")
    private Integer state;
}
